#include <iostream>
#include <climits>
#include <cstdlib>
#include <ctime>
using namespace std;

void testType();
void randFunction();
int get_rand();

void testType()
{
	cout << "2015*12*31 = " << 2015 * 12 * 31 << endl
	     << "INT_MAX  = " << INT_MAX << endl
	     << "LONG_MAX = " << LONG_MAX << "\nmax_years= " << LONG_MAX / 365 << endl;
}

void randFunction()
{
	// cout << "rand() = " << rand() << endl;
	// srand(2); // srand() rand() dapeishiyong
	// cout << "srand() = " << rand() << endl;
	int randArray[10];
	srand(time(NULL));
	for (int i = 0; i < 10; i++) {
		randArray[i] = get_rand()%10;
	}
	for (int i = 0; i < 10; i++) {
		cout << randArray[i] << " \n";
	}
	cout<<endl;
}

int get_rand() {
	int r = rand();
	cout << "time r " << time(NULL) <<" "<< r <<endl;
	return r;
}

int main()
{
	randFunction();
	return 0;
}
